#pragma once
#include <stdio.h>
#include <stdlib.h>
#include <stdint.h>
#include <string.h>
#include <signal.h>
#include <errno.h>
#include <list>
#include <sys/wait.h>
#include <jsoncpp/json/json.h>
#include <NetEngine_Include/XyRyNet_CommHdr.h>
#include <NetEngine_Include/XyRyNet_Types.h>
#include <NetEngine_Include/XyRyNet_ProtocolHdr.h>
#include <NetEngine_Include/NetEngine_BaseLib/BaseLib_Define.h>
#include <NetEngine_Include/NetEngine_BaseLib/BaseLib_Error.h>
#include <NetEngine_Include/NetEngine_Core/NetCore_Define.h>
#include <NetEngine_Include/NetEngine_Core/NetCore_Error.h>
#include <NetEngine_Include/NetEngine_Core/ManagePool_Define.h>
#include <NetEngine_Include/NetEngine_Core/ManagePool_Error.h>
#include <NetEngine_Include/NetEngine_HelpComponents/XLog_Define.h>
#include <NetEngine_Include/NetEngine_HelpComponents/XLog_Error.h>
#include <NetEngine_Include/NetEngine_HelpComponents/Packets_Define.h>
#include <NetEngine_Include/NetEngine_HelpComponents/Packets_Error.h>
#include "../../../WINApt_PktProtocol.h"
#include "../WINApt_Logic/WINApt_LogicSql/LogicSql_Define.h"
#include "../WINApt_Logic/WINApt_LogicSql/LogicSql_Error.h"
#include "../WINApt_Logic/WINApt_LogicProtocol/LogicProtocol_Define.h"
#include "../WINApt_Logic/WINApt_LogicProtocol/LogicProtocol_Error.h"

typedef struct
{
    int nPort;
    int Threads;
    int nDeamon;
    struct
    {
        int nSQLPort;
        TCHAR tszSQLAddr[64];
        TCHAR tszSQLUser[64];
        TCHAR tszSQLPass[64];
    }st_SQLInfo;
}WINAPT_SERVERCONFIG;

extern BOOL bIsRun;
extern XLOG xhLog;
extern XNETHANDLE xhPool;
extern XNETHANDLE xhTCPPacket;
extern XNETHANDLE xhTCPNet;
extern HANDLE hTCPThread;
extern WINAPT_SERVERCONFIG st_ServiceCfg;


#include "WINApt_Config.h"
#include "WINApt_Handle.h"
#include "WINApt_Net.h"

void ServiceApp_Stop(int signo);
